#!/bin/bash
echo "*********开始智慧机器人Robot打包!*********"
while true; do
  read -p "请输入版本号: " APP_VERSION
  if [[ -n "$APP_VERSION" ]]; then
    break
  else
    echo "你输入正确的版本号！！"
  fi
done
npm install
yarn build-prod
FILE_NAME="version.txt"
DATE_TIME=$(date +"%Y-%m-%d %H:%M:%S")
echo "version: $APP_VERSION" > "$FILE_NAME"
echo "builddate: $DATE_TIME" >> "$FILE_NAME"
echo "profile: .env.prod" >> "$FILE_NAME"
echo "版本文件内容："
cat "$FILE_NAME"
mv "$FILE_NAME" ./dist/version.txt
# Assuming "ant" is a valid command on your Linux system
ant
echo "*********结束智慧机器人Robot打包!*********"
read -p "Press any key to continue..." -n1 -s
